import sys
from  PyQt5.QtWidgets import *
if __name__ == '__main__':
    app=QApplication(sys.argv)
    win=QMainWindow()
    win.setWindowTitle('窗口透明度')
    win.resize(400,200)
    win.setWindowOpacity(0.7)
    win.show()
    sys.exit(app.exec_())